﻿package com.yy.ui.general {
    import flash.text.*;

    public class VinciFont {

        public static const USE_EMBED:String = "useEmbed";
        public static const NONUSE_EMBED:String = "nonuseEmbed";
        public static const LANG_EMBED:String = "langEmbed";

        public static var DEFAULTFONT:String = "Tahoma";
        public static var INCLUDE_LANG_EMBED:String = "en";

        private var name:String;
        private var size:uint;
        private var bold:Boolean;
        private var italic:Boolean;
        private var underline:Boolean;
        private var textFormat:TextFormat;
        private var textAlign:String;
        private var leading:int;
        private var _color:uint = 0xFFFFFF;
        private var advancedProperties:FontAdvProperties;

        public function VinciFont(_arg1:String=null, _arg2:uint=11, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=false, _arg6=null, _arg7:String="left", _arg8:int=0, _arg9:Object=null){
            if (_arg1 == null){
                _arg1 = DEFAULTFONT;
            };
            var _local10:String;// = App.appLang;
            this.name = _arg1;
            if (((!((_arg9 == null))) && (_arg9.hasOwnProperty(_local10)))){
                this.size = _arg9[_local10];
            } else {
                this.size = _arg2;
            };
            this.bold = _arg3;
            this.italic = _arg4;
            this.underline = _arg5;
            if ((_arg6 is FontAdvProperties)){
                this.advancedProperties = (_arg6 as FontAdvProperties);
            } else {
                this.advancedProperties = new FontAdvProperties(_arg6);
            };
            this.textAlign = _arg7;
            this.leading = _arg8;
            this.textFormat = this.getTextFormat();
        }
        public function getName():String{
            return (this.name);
        }
        public function changeName(_arg1:String):VinciFont{
            return (new VinciFont(_arg1, this.size, this.bold, this.italic, this.underline, this.advancedProperties));
        }
        public function getSize():uint{
            return (this.size);
        }
        public function changeSize(_arg1:int):VinciFont{
            return (new VinciFont(this.name, _arg1, this.bold, this.italic, this.underline, this.advancedProperties));
        }
        public function isBold():Boolean{
            return (this.bold);
        }
        public function changeBold(_arg1:Boolean):VinciFont{
            return (new VinciFont(this.name, this.size, _arg1, this.italic, this.underline, this.advancedProperties));
        }
        public function isItalic():Boolean{
            return (this.italic);
        }
        public function changeItalic(_arg1:Boolean):VinciFont{
            return (new VinciFont(this.name, this.size, this.bold, _arg1, this.underline, this.advancedProperties));
        }
        public function isUnderline():Boolean{
            return (this.underline);
        }
        public function changeUnderline(_arg1:Boolean):VinciFont{
            return (new VinciFont(this.name, this.size, this.bold, this.italic, _arg1, this.advancedProperties));
        }
        public function isEmbedFonts():Boolean{
            return (this.advancedProperties.isEmbedFonts());
        }
        public function getAdvancedProperties():FontAdvProperties{
            return (this.advancedProperties);
        }
        public function apply(_arg1:TextField, _arg2:int=-1, _arg3:int=-1):void{
            this.advancedProperties.apply(_arg1);
            _arg1.setTextFormat(this.textFormat, _arg2, _arg3);
            _arg1.defaultTextFormat = this.textFormat;
        }
        public function getTextFormat():TextFormat{
            return (new TextFormat(this.name, this.size, null, this.bold, this.italic, this.underline, "", "", this.textAlign, 0, 0, 0, this.leading));
        }
        public function clone():VinciFont{
            return (new VinciFont(this.name, this.size, this.bold, this.italic, this.underline, this.advancedProperties));
        }
        public function toString():String{
            return (((((((((((((("VinciFont[" + "name : ") + this.name) + ", size : ") + this.size) + ", bold : ") + this.bold) + ", italic : ") + this.italic) + ", underline : ") + this.underline) + ", advanced : ") + this.advancedProperties) + "]"));
        }
        public function get color():uint{
            return (this._color);
        }
        public function set color(_arg1:uint):void{
            this._color = _arg1;
        }

    }
}